# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Alexander Baldeck <alexander@archlinux.org>
# Contributor: tobias <tobias@archlinux.org>

pkgname=ftgl
_pkgver=2.1.3-rc5
pkgver=2.4.0
pkgrel=2
pkgdesc="OpenGL library to use arbitrary fonts"
arch=(loong64 x86_64)
url="https://github.com/frankheckenbach/ftgl"
license=(MIT)
depends=(freetype2 glu)
makedepends=(doxygen mesa graphviz git)
_commit=483639219095ad080538e07ceb5996de901d4e74  # tags/v2.4.0
source=("git+https://github.com/frankheckenbach/ftgl#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname
  printf '%s\n' >>docs/doxygen.cfg.in \
    HAVE_DOT=yes DOT_IMAGE_FORMAT=svg INTERACTIVE_SVG=yes
  ./autogen.sh
}

build() {
  cd $pkgname
  ./configure --prefix=/usr --with-pic --disable-static
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install

  # FS#23283: install missing headers for OpenCascade
  install -Dt "$pkgdir/usr/include/FTGL" -m644 src/FT{Face,Size}.h

  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 COPYING
}

# vim:set sw=2 et:
